from django.db import models

class Article(models.Model):
    title = models.CharField(max_length=100, verbose_name='标题')
    content = models.TextField(verbose_name='文章内容')
    source = models.CharField(max_length=10, choices=(('1','原创'),('2','转载')), verbose_name='来源')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        db_table = "blog_article"
        verbose_name_plural = "文章管理"
        ordering = ('-create_time',)

    def __str__(self):
        return self.title